package org.bozo.im.service.core.roster;

import java.util.ArrayList;

import org.bozo.im.common.types.Protocol;
import org.bozo.im.common.types.RawContact;
import org.bozo.im.service.core.database.DatabaseHelper;

import android.content.Context;
import android.os.Build;

public abstract class AbstractContactProvider {

	public static final AbstractContactProvider getProvider(Context pContext, DatabaseHelper mDatabase) {
		int lSdkVersion = Integer.parseInt(Build.VERSION.SDK);
		
		if (lSdkVersion < Build.VERSION_CODES.ECLAIR) {
			return null;
		} else {
			return new org.bozo.im.service.core.roster.eclair.ContactProvider(pContext, mDatabase);
		}
	}
	
	public abstract void addContacts(ArrayList<ContactDesc> pDescs);

	public abstract RawContact getContact(Protocol pProtocol, String pHandle);
	
	public abstract ArrayList<RawContact> getContacts();
	
	public abstract void updateContact(RawContact pContact, RawContact.Field pField);
}
